﻿@model Services.Schedules
@{
    ViewBag.Title = "AddSchedule";
    Layout = "~/_Layout.cshtml";
}
<style type="text/css">
    .schedule_content {
        width: 400px;
        height: 100px;
    }
</style>
<h2>AddSchedule</h2>
@using (Html.BeginForm("NewSchedule", "Schedule", FormMethod.Post, new { @schedule = Model }))
{ 
    <table class="tab">
        <tr>
            <td colspan="2" style="text-align: center;"><span id="span_title_info" style="font-weight: bold;"></span></td>
        </tr>
        <tr>
            <td>标题:</td>
            <td>@Html.TextBoxFor(p => p.Title)</td>
        </tr>
        <tr>
            <td>内容:</td>
            <td>@Html.TextAreaFor(p => p.Contents, new { @class = "schedule_content" })</td>
        </tr>
        <tr>
            <td colspan="2" style="text-align: center;">
                <input id="btn_submit" type="submit" class="btn" value="添加" onclick="return CheckForm();" />
                <input id="btn_back" type="button" class="btn" value="返回" />
            </td>
        </tr>
    </table>
}
<script type="text/javascript">

    $("#btn_back").click(function () {
        window.location.href = "/Schedule/MyScheduleList";
    })

    function CheckForm() {
        var v1 = $("#Title").val();
        var v2 = $("#Contents").val();

        if (v1 == "" || v2 == "") {
            return false;
        }
        return true;
    }
</script>